package com.hutao.manage.test;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.xml.bind.annotation.adapters.XmlAdapter;

public class JaxbDateAdapter extends XmlAdapter<String, Date> {

	 private final static SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyy-MM-dd HH:mm");
	  
	    @Override  
	    public Date unmarshal(String v) throws Exception {  
	        return yyyyMMddHHmmss.parse(v);  
	    }  
	  
	    @Override  
	    public String marshal(Date v) throws Exception {  
	        return yyyyMMddHHmmss.format(v);  
	    }  
}
